<ui:composition template="/templates/main.xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:c="http://java.sun.com/jsp/jstl/core"
		xmlns:rich="http://richfaces.org/rich" >
		<ui:define name="navigation">
		<ui:include src="templates/includes/myDetails.xhtml"></ui:include>
		</ui:define>
		<ui:define name="body">
		<link rel="stylesheet" href="css/themes/redmond/jquery.ui.all.css" />
		<script src="js/ui/jquery.ui.position.js"></script>
		<script src="js/ui/jquery.ui.resizable.js"></script> 
		<script src="js/ui/jquery.ui.core.js"></script>
		<script src="js/ui/jquery.ui.widget.js"></script>
		<script src="js/ui/jquery.ui.dialog.js"></script>
		
		<script>
	$(function() {
		$( "#dialog" ).dialog({
			autoOpen: false,
			show: "blind",
			hide: "explode",
			width: 810,
			height: 500,
			modal: true
		});
	});
	</script>
		
<style>
	.tableStyle {
		width: 100%;	
	}
	.rf-dt-c{
	   text-align: center;
	}
	.rf-ds{
	   margin-top:10px;
	   margin-left:450px;
	}
	.right{
    color: #000000;
    padding-left: 120px;
    vertical-align: middle;
     }
</style>


			<h:form>
	
	   <rich:panel>
		<f:facet name="header">
			<h:outputText value="分享的资料" />
		</f:facet>  
		<div align="right" style="height:35px;">
		<h:form>
			<input type="radio" value="1" name="#{searchshare.searchType}" checked="checked">标题</input>
			<input type="radio" value="2" name="#{searchshare.searchType}">作者</input>
			<input type="radio" value="3" name="#{searchshare.searchType}">关键字</input>
            <h:inputText value="#{searchshare.searchContext}"></h:inputText>
			<h:commandButton value="检索" action="#{searchshare.searchshareAction}">
			</h:commandButton>
		</h:form>
		</div>
	  <div class="di"></div>
	<div class="TreeMenu">
	<c:if test="#{searchshare.row eq 0}">
					<div align="center">
						<img src="images/icons/broken.png" width="50" height="50"/><h1>没有所要查询的内容！</h1>
					</div>
			   </c:if>	
				<c:if test="#{searchshare.row != 0}">
				<h:form>
				<rich:dataTable value="#{searchshare.docList}" var="doc" id="table"
					rows="15" width="800" styleClass="tableStyle">
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="标  题" />
						</f:facet>

						<h:outputText value="#{doc.title}" />
					</rich:column>
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="作  者" />
						</f:facet>
						<h:outputText value="#{doc.author}" />
					</rich:column>
					
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="类  别" />
						</f:facet>
						<h:outputText value="#{doc.classify}"
							style="height: 50px; width: 200px" />
					</rich:column>
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="主 题" />
						</f:facet>
						<h:outputText value="#{doc.themewords}"
							style="height: 50px; width: 200px" />
					</rich:column>
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="关键字" />
						</f:facet>
						<h:outputText value="#{doc.keywords}"
							style="height: 50px; width: 200px" />
					</rich:column>
					<rich:column width="50px">
						<f:facet name="header">
							<h:outputText value="创建时间" />
						</f:facet>
						<h:outputText value="#{doc.createtime}">
							<f:convertDateTime pattern="yyyy年MM月dd日  HH:mm:ss"/>
						</h:outputText>
						
					</rich:column>
					<rich:column width="50px">
						<f:facet name="header">
							<h:outputText value="修改时间" />
						</f:facet>
						<h:outputText value="#{doc.edittime}">
							<f:convertDateTime pattern="yyyy年MM月dd日 hh:mm:ss"/>
						</h:outputText>
						
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="浏览" />
						</f:facet>
						<a onclick="$('#dialog').dialog( 'open' );" id="opener" href="ShowOne.jsf?id=#{doc.documentid}" target="info">
							<img height="20px" width="20px" src="images/icons/view.png" alt="查看" /> 
						</a>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="评论" />
						</f:facet>
						<a onclick="$('#dialog').dialog( 'open' );" id="opener" href="Commentbean.jsf?commentid=#{doc.documentid}" target="info">
							<img height="20px" width="20px" src="images/icons/editefile.png" alt="评论" /> 
						</a>
					</rich:column>
					<rich:column>
						<f:facet name="header">
							<h:outputText value="下载" />
						</f:facet>
						<a onclick="javascript:window.location.href='File2Word?id='+#{doc.documentid}" id="opener" target="info">
							<img height="20px" width="20px" src="images/icons/download.jpg" alt="下载" style="cursor:pointer;"/> 
						</a>
						
					</rich:column>
					<rich:column width="200">
						<f:facet name="header">
							<h:outputText value="分享者" />
						</f:facet>
						<a onclick="$('#dialog').dialog( 'open' );" id="opener" href="EditMessage.jsf?messageuser=#{doc.secondauthor}" target="info">
						<h:outputText value="#{doc.secondauthor}" style="width: 100px" />
						</a>
					</rich:column>
				</rich:dataTable>
					<rich:dataScroller for="table" id="scp" align="right"
					renderIfSinglePage="true" maxPages="30"> 
					 <f:facet name="first">
                    <h:outputText value="first"/>
                     </f:facet>
                    <f:facet name="last">
                    <h:outputText value="last"/>
                     </f:facet>
                 </rich:dataScroller>
                 </h:form>
				</c:if>
	 </div>
	</rich:panel>
				
			</h:form>
			<div id="dialog" title="详细信息">	
				<iframe align="left"  frameborder="0" name="info" width="780px" height="450px;" />
			</div>
	
		</ui:define>
	</ui:composition>